# @Filename:    sample1
# @Author:      王佳伟
# @Time:        2025-02-25 16:56
# @Describe:    接口性能测试
import time
import requests

def measure_response_time(api_url):
    start_time = time.time()
    response = requests.get(api_url)
    end_time = time.time()
    response_time = end_time - start_time
    print(f'接口{api_url}的响应时间为：{response_time}秒')

if __name__ == '__main__':
    api_urls = ['https://www.baidu.com/', 'https://www.csdn.net/']
    for url in api_urls:
        measure_response_time(url)